<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<script type="text/javascript" src="jq/jquery-3.7.1.js"></script>
<body>
<form action="updateUserServlet" method="get" id="forms">
			 序号<input type="text" name="userId" id="userId"  value="${param.id }" readonly><br>
		          用户名<input type="text" name="userName" id="userName"  value="${param.username }"><br>
		          密码<input type="text" name="userPass" id="userPass"  value="${param.userpass }"><br>
		          地址<input type="text" name="position" id="position"  value="${param.position }"><br>
		          电话<input type="text" name="phone" id="phone"  value="${param.phone }"><br>
		          状态<input type="text" name="state" id="state" value="${param.state }"><br>
		     <input type="button" value="确认修改" id="userUpdate">
</form>
</body>
<script type="text/javascript">
$("#userUpdate").click(function(){
	if($("input[name=userName]").val()==""){
		alert("用户名未填写！！！");
	}
	else if($("input[name=userPass]").val()==""){
		alert("密码未填写！！！");
	}
	else if($("input[name=position]").val()==""){
		alert("地址未填写！！！");
	}
	else if($("input[name=phone]").val()==""){
		alert("电话未填写！！！");
	}
	else if($("input[name=state]").val()==""){
		alert("状态未填写！！！");
	}
	else if($("input[name=state]").val()!=1 && $("input[name=state]").val()!=0){
		alert("状态只能设置为0和1！！！");
	}else{
		$("#forms").submit();
	}
	
});

</script>
</html>